package com.medical.controller;

import com.medical.pojo.MyRepair;
import com.medical.service.MyRepairService;
import com.medical.vo.Rmed;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("myRepair")
public class MyRepairController {

    @Autowired
    private MyRepairService myRepairService;

    @RequestMapping("/findAll")
    public List<MyRepair> findAll(){
        return myRepairService.findAll();
    }

    @RequestMapping("/findById")
    public MyRepair findById(Integer id){
        return myRepairService.findById(id);
    }

    @RequestMapping("/updateRepair")
    public Rmed updateRepair(@RequestBody MyRepair myRepair){
        return myRepairService.updateRepair(myRepair);
    }

    @RequestMapping("/updateReject")
    public Rmed updateReject(@RequestBody MyRepair myRepair){
    	return myRepairService.updateReject(myRepair);
    }
}
